#ifndef __LCD_H
#define __LCD_H 

#include "maos_include.h"

#ifdef __cplusplus
extern "C"{
#endif
	
typedef struct
{
	u16  x1;
	u16  y1;
	u16  x2;
	u16  y2;
}RANGE;

typedef struct
{
	void 	*base;
	char 	*data;
	u8		vlen;
	u8		hlen;
}FONT;

typedef struct
{
	u16 	width;
	u16 	height;
	u8		*data;
	
}ICON;


typedef struct
{
	u8 *dispBuf;
	bool (*read_point)(u8 x,u8 y);
	void (*draw_hline)(u8 x1,u8 x2,u8 y,bool color);
	void (*draw_vline)(u8 x,u8 y1,u8 y2,bool color);
	void (*draw_range)(RANGE range,bool color);
	void (*draw_circle)(RANGE range,u8 x, u8 y,u8 r,bool color,bool fill);
	void (*draw_str)(u8 x, u8 y,char *str,u8 size,bool color);
	void (*draw_icon)(u8 x, u8 y,ICON icon,bool color);
	void (*refresh)(RANGE range);
	void (*init)(void);
	
}LCDFUN;
extern LCDFUN lcd;

#define	ICON_UP				0x01
#define	ICON_DOWN			0x02
#define	ICON_LEFT			0x03
#define	ICON_RIGHT			0x04
#define	ICON_UP_DOWN		0x05


#ifdef __cplusplus
}
#endif
#endif /* __LCD_BSP1_H */
